﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LuceneManager;
using System.Configuration;
using System.IO;
using Common;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KnowFirstWebApplication
{
    public static class UIHelper
    {
        public  const string USERNAME = "UserName";
        public  const string CATEGORY = "Category";
        public static List<int> GetDaysInMonth()
        {
            List<int> dayslist = new List<int>();
            for (int i = 1; i < 32; i++)
            {
                dayslist.Add(i);
            }
            return dayslist;
        }
        public static List<int> GetMonthesInYear()
        {
            List<int> dayslist = new List<int>();
            for (int i = 1; i < 13; i++)
            {
                dayslist.Add(i);
            }
            return dayslist;
        }
        public static List<int> GetYearsFrom1990To2020()
        {
            List<int> dayslist = new List<int>();
            for (int i = 1990; i < 2020; i++)
            {
                dayslist.Add(i);
            }
            return dayslist;
        }

       

        public static string ArrangeExcerpts(string[] Excerpts)
        {
            StringBuilder sb = new StringBuilder();
            if (null == Excerpts)
                return sb.ToString();
            foreach (string s in Excerpts)
            {
                sb.Append(String.Format("{0}<br>", s));
            }
            return sb.ToString();
        }

        public static List<IndexNode> LoadIndexNodes()
        {
            IndexNodes nodes = new IndexNodes();
            nodes = XmlClassHandler<IndexNodes>.Load(HttpContext.Current.Server.MapPath("~/App_Data/Nodes.xml"));
            return nodes.Nodes;
        }



    }
}
